//rastrigin problem-depended class
//$Id: rastrigin_sa.h 332 2010-02-06 18:30:14Z Oleg.Bulychov $
#pragma once

#include "../rastrigin.h"
#include "solvers/sa/sa_common.h"
//__________________________________________________________________________________
template<>
struct solution<Rastrigin_Solution, sa_tag>:
    public Rastrigin_Solution
{
public:
    template<class E>
    void move(E* env, uniform_random& rnd, double probability)
    {
        for (size_t i = 0; i < env->problem_.n_; ++i)
        {
            if (rnd.next_Double() < probability)
            {
                data_[i] = env->problem_.lbound_+rnd.next_Double()*(env->problem_.rbound_-env->problem_.lbound_);
                changed_ = true;
            }
        }
    }
};
//__________________________________________________________________________________

//EOF!
